import { request } from '@/api/request';
import { APIUNICRONZP } from '@/common';
interface PayLogsListType {
  orderId: string;
  amount: number;
  payTime: string;
  payPersonName: string;
  payPersonPhone: string;
  entName: string;
  buyInfo: string;
  payType: string | number;
  ThirdOrderNumber: string;
  ThirdAccountName: number;
}
/**
 * @desc 收款记录统计
 */

export async function getEventStatistics(params: any) {
  const { data } = await request<any>({
    url: `${APIUNICRONZP}order/record/count`,
    params,
    method: 'get',
  });
  return data;
}

export async function getPaymentLogsList(params: any) {
  const { data } = await request<any>({
    url: `${APIUNICRONZP}order/list`,
    params,
    method: 'get',
  });
  return data;
}
export async function exoprtApi(params: any) {
  // const { data } = await request<any>({
  //   url: `${APIUNICRONZP}order/export`,
  //   params,
  //   method: 'get',
  // });
  // return data;
  const newWindow = window.open(`${APIUNICRONZP}order/export?year=${params.year}&month=${params.month}`, '_blank');
  newWindow?.focus();
}
export type { PayLogsListType };
